package com.example.weatherforecast

import android.util.Xml
import org.junit.Test
import org.junit.Assert.*
import org.xmlpull.v1.XmlPullParser
import java.io.File
import java.util.regex.Pattern

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {
    @Test
    fun addition_isCorrect() {
        assertEquals(4, 2 + 2)
    }

    @Test
    fun matchWindLevel(){
        val regex = "(<!\\[CDATA\\[)(.*)(]])>"
        val pattern = Pattern.compile(regex)
        val matcher = pattern.matcher("<![CDATA[1级]]>")

        if (matcher.find()){
            println(matcher.group(2))
        }
    }
}